package controllers;

import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;


import model.entities.ChubLogNew;
import myDaos.LogsDao;

@ManagedBean
@SessionScoped
public class LogsManagedBean {
private List<ChubLogNew> logs;
private String name;
private String msg;
private Date from;
private Date to;
@EJB
private LogsDao ld;
 



public String getName() {
	return name;
}


public void setName(String name) {
	this.name = name;
}


public String getMsg() {
	return msg;
}


public void setMsg(String msg) {
	this.msg = msg;
}


public Date getFrom() {
	return from;
}


public void setFrom(Date from) {
	this.from = from;
}


public Date getTo() {
	return to;
}


public void setTo(Date to) {
	this.to = to;
}


public List<ChubLogNew> getLogs() {
	return logs;
}


public void setLogs(List<ChubLogNew> logs) {
	this.logs = logs;
}

public void updateList(){
	logs=ld.getLogsByFilter(name,msg,from,to);
}

@PostConstruct
public void init(){
	logs=ld.getLogs();
}


}
